notebook: Simplify gtk_notebook_map()
authorBenjamin Otte <otte@redhat.com>
Sat, 19 Dec 2015 07:03:41 +0000 (08:03 +0100)
committerBenjamin Otte <otte@redhat.com>
Mon, 11 Jan 2016 16:05:22 +0000 (17:05 +0100)
We set visibility on our children properly, so we can simply chain up
and let the GtkContainer implementation do the mapping of children.

gtk/gtknotebook.c

index 15276063c6acbcae94d3cd784ff87428e2d9a7a2..c71b43bf44645d38e951b0d555fb2af5867e292f 100644 (file)
@@ -1972,43 +1972,8 @@ gtk_notebook_map (GtkWidget *widget)
 {
   GtkNotebook *notebook = GTK_NOTEBOOK (widget);
   GtkNotebookPrivate *priv = notebook->priv;
-  GtkNotebookPage *page;
-  GList *children;
-  gint i;
-
-  gtk_widget_set_mapped (widget, TRUE);
-
-  if (priv->cur_page &&
-      gtk_widget_get_visible (priv->cur_page->child) &&
-      !gtk_widget_get_mapped (priv->cur_page->child))
-    gtk_widget_map (priv->cur_page->child);
-
-  for (i = 0; i < N_ACTION_WIDGETS; i++)
-    {
-      if (priv->action_widget[i] &&
-          gtk_widget_get_visible (priv->action_widget[i]) &&
-          gtk_widget_get_child_visible (priv->action_widget[i]) &&
-          !gtk_widget_get_mapped (priv->action_widget[i]))
-        gtk_widget_map (priv->action_widget[i]);
-    }
-
-  if (priv->scrollable)
-    gtk_notebook_pages_allocate (notebook);
-  else
-    {
-      children = priv->children;
-
-      while (children)
-        {
-          page = children->data;
-          children = children->next;
 
-          if (page->tab_label &&
-              gtk_widget_get_visible (page->tab_label) &&
-              !gtk_widget_get_mapped (page->tab_label))
-            gtk_widget_map (page->tab_label);
-        }
-    }
+  GTK_WIDGET_CLASS (gtk_notebook_parent_class)->map (widget);
 
   if (gtk_notebook_get_event_window_position (notebook, NULL))
     gdk_window_show_unraised (priv->event_window);